package com.service.impl;/*
 *
 *作者：张继成
 *任务：系统相关简介用于显示在管理员权限的展示页面
 *
 *备注：关于我们，系统的相关介绍。
 *@Date2023/06/01/21:30
 ***/

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.SystemintroDao;
import com.entity.SystemintroEntity;
import com.entity.view.SystemintroView;
import com.entity.vo.SystemintroVO;
import com.service.SystemintroService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("systemintroService")
public class SystemintroServiceImpl extends ServiceImpl<SystemintroDao,SystemintroEntity> implements SystemintroService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //调用Mybatis-plus的分页功能
        Page<SystemintroEntity> page=this.selectPage(
                //Mybatis-plus查询方法
                new Query<SystemintroEntity>(params).getPage(),
                //entitywrapper方法是一个众所周知的方法，
                // 它是一个实体包装器，可以通过链式编程方式构建查询条件，
                // 从而方便地进行复杂的数据查询和操作
                new EntityWrapper<SystemintroEntity>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<SystemintroEntity> wrapper) {
        Page<SystemintroView> page =new Query<SystemintroView>(params).getPage();
        //调用mybatis-plus的baseMapper接口进行一个查询试图
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<SystemintroVO> selectListVO(Wrapper<SystemintroEntity> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public SystemintroVO selectVO(Wrapper<SystemintroEntity> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<SystemintroView> selectListView(Wrapper<SystemintroEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public SystemintroView selectView(Wrapper<SystemintroEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }

}
